package com.swjd.controller;

import com.swjd.pojo.Student;
import com.swjd.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author 刘涛
 * @create 2021/11/9 9:43
 */
@Controller
@ResponseBody
@RequestMapping("/student")
public class StudentController {
    @Autowired
    private StudentService studentService;

    @GetMapping("/findById")
    public Student findById(int id) {
        Student byId = studentService.findById(id);
        return byId;
    }
}
